﻿Namespace Aricie.DNN.Caching
    Public Class DistributedCachingProvider4
        Inherits DotNetNuke.Services.Cache.CachingProvider



        Public Overrides Function Add(ByVal key As String, ByVal value As Object, ByVal dependencies As System.Web.Caching.CacheDependency, _
                                      ByVal absoluteExpiration As Date, ByVal slidingExpiration As System.TimeSpan, ByVal priority As System.Web.Caching.CacheItemPriority, _
                                      ByVal onRemoveCallback As System.Web.Caching.CacheItemRemovedCallback) As Object
            Return DistributedCachingProviderBase.Instance.Add(key, value, dependencies, absoluteExpiration, slidingExpiration, priority, onRemoveCallback)
        End Function

        Public Overrides Function GetEnumerator() As System.Collections.IDictionaryEnumerator
            Return DistributedCachingProviderBase.Instance.GetEnumerator
        End Function

        Public Overrides Function GetItem(ByVal cacheKey As String) As Object
            Return DistributedCachingProviderBase.Instance.GetItem(cacheKey)
        End Function

        Public Overrides Function GetPersistentCacheItem(ByVal cacheKey As String, ByVal objType As System.Type) As Object
            Return DistributedCachingProviderBase.Instance.GetPersistentCacheItem(cacheKey, objType)
        End Function

        Public Overloads Overrides Sub Insert(ByVal cacheKey As String, ByVal objObject As Object, ByVal persistAppRestart As Boolean)
            DistributedCachingProviderBase.Instance.Insert(cacheKey, objObject, persistAppRestart)
        End Sub

        Public Overloads Overrides Sub Insert(ByVal cacheKey As String, ByVal objObject As Object, ByVal objDependency As System.Web.Caching.CacheDependency, ByVal persistAppRestart As Boolean)
            DistributedCachingProviderBase.Instance.Insert(cacheKey, objObject, objDependency, persistAppRestart)
        End Sub

        Public Overloads Overrides Sub Insert(ByVal cacheKey As String, ByVal objObject As Object, ByVal objDependency As System.Web.Caching.CacheDependency, _
                                              ByVal absoluteExpiration As Date, ByVal slidingExpiration As System.TimeSpan, ByVal persistAppRestart As Boolean)
            DistributedCachingProviderBase.Instance.Insert(cacheKey, objObject, objDependency, absoluteExpiration, slidingExpiration, persistAppRestart)
        End Sub

        Public Overloads Overrides Sub Insert(ByVal cacheKey As String, ByVal objObject As Object, ByVal objDependency As System.Web.Caching.CacheDependency, _
                                              ByVal absoluteExpiration As Date, ByVal slidingExpiration As System.TimeSpan, ByVal priority As System.Web.Caching.CacheItemPriority, _
                                              ByVal onRemoveCallback As System.Web.Caching.CacheItemRemovedCallback, ByVal persistAppRestart As Boolean)

            DistributedCachingProviderBase.Instance.Insert(cacheKey, objObject, objDependency, absoluteExpiration, _
                                                           slidingExpiration, priority, onRemoveCallback, persistAppRestart)

        End Sub

        Public Overrides Function PurgeCache() As String
            Return DistributedCachingProviderBase.Instance.PurgeCache()
        End Function

        Public Overrides Sub Remove(ByVal cachekey As String)
            DistributedCachingProviderBase.Instance.Remove(cachekey)

        End Sub

        Public Overrides Sub RemovePersistentCacheItem(ByVal cacheKey As String)
            DistributedCachingProviderBase.Instance.RemovePersistentCacheItem(cacheKey)

        End Sub
    End Class
End Namespace